

<template>
  <el-container style="height: 500px; border: 1px solid #eee">
    <el-container>
      <el-aside class="el-aside" width="200px" style="background-color: #19374b">
        <v-menu2/>
      </el-aside>
      <el-main class="elMain">
        <!-- 标题 -->
        <el-row class="lineHight70 paddingLeft80 bgFd">
          <el-breadcrumb separator=">">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item :to="{ path: '/' }">买家中心</el-breadcrumb-item>
            <el-breadcrumb-item>主页管理</el-breadcrumb-item>
          </el-breadcrumb>
        </el-row>
        <!-- 文件上传 -->
        <div class="width1200 margin0auto marginTop34 bgWhite padding20">
          <el-row>
            <el-col :span="24">
              <el-upload
                class="upload-demo"
                drag
                action="https://jsonplaceholder.typicode.com/posts/"
                multiple
              >
                <i class="el-icon-upload"></i>
                <div class="el-upload__text">
                  将文件拖到此处，或
                  <em>点击上传</em>
                </div>
                <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
              </el-upload>
            </el-col>
          </el-row>
        </div>
        <!-- 公司信息 -->
        <div class="width1200 marginTop45 margin0auto bgWhite">
          <div class="displayInlineBlock width388 height913px fl bgFCFCFC">
            <!-- 图片 -->
            <div class="imgContains size170">
              <img :src="getImgUrl(corpBaseInfo.logo)" alt="">
            </div>
            <el-row>
              <el-col :span="24" class="companyName textCenter">{{corpBaseInfo.name}}</el-col>
              <el-col :span="24" class="companyContent textCenter">产品方案:&nbsp;&nbsp;{{solutionCount}}&nbsp;&nbsp;案例:{{casesCount}}</el-col>
              <div class="companySmallContent">{{corpContent}}</div>
            </el-row>
            <!-- 信息 -->
          </div>
          <div class="displayInlineBlock width812 height913px">
            <div class="borderBottom marginTop45">
              <el-tabs v-model="activeName" stretch @tab-click="tabsClick">
                <el-tab-pane label="供应商简介" name="first">
                  <el-row>
                    <!-- 供应商基本情况 -->
                    <el-col :span="22" :offset="1" class="boderBottom paddingBottom46">
                      <el-row class="marginTop20">
                        <el-col :span="22">
                          <el-row class="lineHeight36 margin20">供应商基本情况</el-row>
                          <el-row class="lindeHeight36">
                            <el-col :span="3" class="color999">经营年限：</el-col>
                            <el-col :span="12" class="color333">{{corpBaseInfo.engageYear}}</el-col>
                          </el-row>
                          <el-row class="lindeHeight36">
                            <el-col :span="3" class="color999">企业位置：</el-col>
                            <el-col :span="12" class="color333">
                              <span class="iconfont icondizhi1 color0FC18A"></span>
                              {{corpBaseInfo.addressProvence}}
                              {{corpBaseInfo.addressCity}}
                              {{corpBaseInfo.addressCounty}}
                              {{corpBaseInfo.addressStreet}}
                            </el-col>
                          </el-row>
                          <el-row class="lindeHeight36">
                            <el-col :span="3" class="color999">企业简介：</el-col>
                            <el-col :span="12" class="color333">{{corpBaseInfo.summary}}</el-col>
                          </el-row>
                        </el-col>
                        <el-col :span="2">
                          <span class="iconfont iconshezhi fontSize28 cupointer"></span>
                        </el-col>
                      </el-row>
                    </el-col>
                    <!-- 业务范围 -->
                    <el-col :span="22" :offset="1" class="boderBottom paddingBottom46">
                      <el-row class="marginTop20">
                        <el-col :span="22">
                          <el-row class="lineHeight36 margin20">业务范围</el-row>
                          <el-row class="lindeHeight36">
                            <el-tag size="mini" color="#6fbc85" class="colorWhite" v-for="(btnItem,index) in corpScope" v-show="btnItem" v-if="index==0" :key="btnItem">{{btnItem}}</el-tag>
                            <el-tag size="mini" color="#00c1de" class="colorWhite" v-for="(btnItem,index) in corpScope" v-show="btnItem" v-if="index==1" :key="btnItem">{{btnItem}}</el-tag>
                            <el-tag size="mini" color="#deb85e" class="colorWhite" v-for="(btnItem,index) in corpScope" v-show="btnItem" v-if="index==2" :key="btnItem">{{btnItem}}</el-tag>
                          </el-row>
                        </el-col>
                        <el-col :span="2">
                          <span class="iconfont iconshezhi fontSize28 cupointer"></span>
                        </el-col>
                      </el-row>
                    </el-col>
                    <!-- 公司介绍 -->
                    <el-col :span="22" :offset="1" class="boderBottom paddingBottom46">
                      <el-row class="marginTop20">
                        <el-col :span="22">
                          <el-row class="lineHeight36 margin20">公司介绍</el-row>
                          <el-row class="lindeHeight36 color999">{{corpContent}}</el-row>
                        </el-col>
                        <el-col :span="2">
                          <span class="iconfont iconshezhi fontSize28 cupointer"></span>
                        </el-col>
                      </el-row>
                    </el-col>
                    <!-- 添加自定义内容 -->
                    <el-col :span="8" class="textCenter marginTop45 cupointer" :offset="8">
                      <span class="iconfont icontianjia"></span>&nbsp;&nbsp;
                      <span class="color0FC18A">添加自定义内容</span>
                    </el-col>
                  </el-row>
                </el-tab-pane>
                <el-tab-pane label="解决方案" name="second">
                  <el-row :gutter="20">
                    <el-col :span="22" class="singleProgram programList">
                      <el-row class="bgWhite">
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0"
                          v-for="succseeCaseItem in solution"
                          :key="succseeCaseItem.id"
                        >
                          <el-row>
                            <el-col :span="9">
                              <div class="imgContains size107a113">
                                <img :src="getImgUrl(succseeCaseItem.thumb)" alt="">
                              </div>
                            </el-col>
                            <el-col :span="15" class="companyTitle">
                              <el-row>
                                <el-col
                                  :span="24"
                                  class="color333 fontSize17 overEclipse"
                                >{{succseeCaseItem.name}}</el-col>
                              </el-row>
                              <el-row class="schema heightClap2">{{succseeCaseItem.summary}}</el-row>
                              <el-row>
                                <el-col :span="24" class="companyBtn height48">
                                  <el-tag
                                    size="mini"
                                    color="#6fbc85"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==0"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#00c1de"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==1"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#deb85e"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==2"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                </el-col>
                              </el-row>
                            </el-col>
                            <el-col :span="24" class="companyBorder">
                              <el-row>
                                <el-col :span="14">
                                  <span class="iconfont iconGroup- color999" v-if="succseeCaseItem.stateCode==4"></span>
                                  <span class="iconfont iconcuowu color999" v-else></span>
                                  <span class="color999" v-if="succseeCaseItem.stateCode==4">发布时间：{{succseeCaseItem.pdate}}</span>
                                  <span class="color999" v-else></span>
                                </el-col>
                                <el-col :span="10" class="textRight">
                                  <span
                                  @click="downLoad(succseeCaseItem.id)"
                                    class="iconfont iconxiazai- pointer fontSize20 marginRight16"
                                    v-if="succseeCaseItem.stateCode==4"
                                  ></span>
                                  <span
                                    class="iconfont iconshangchuan3 pointer fontSize20 marginRight16"
                                    @click="uploadItem(succseeCaseItem.id)"
                                    v-else
                                  ></span>
                                  <span
                                    class="iconfont iconbianji1 pointer fontSize20 marginRight16"
                                    @click="editItem(succseeCaseItem.id)"
                                  ></span>
                                  <span
                                    class="iconfont iconshanchu pointer fontSize20 marginRight16"
                                    @click="delIcon(succseeCaseItem.id)"
                                  ></span>
                                </el-col>
                              </el-row>
                            </el-col>
                          </el-row>
                        </el-col>
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0 bgFd"
                        >
                          <el-row
                            class="lineHeight195 pointer textCenter"
                            @click.native="addNewSolute"
                          >
                            <span class="iconfont icontianjia fontSize40"></span>
                            <span class="colorPrimary verticalAlignSuper">&nbsp;&nbsp;添加解决方案</span>
                          </el-row>
                        </el-col>
                      </el-row>
                    </el-col>
                  </el-row>
                </el-tab-pane>
                <el-tab-pane label="成功案例" name="third">
                  <el-row :gutter="20">
                    <el-col :span="22" class="singleProgram programList">
                      <el-row class="bgWhite">
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0"
                          v-for="succseeCaseItem in succseeCase"
                          :key="succseeCaseItem.id"
                        >
                          <el-row>
                            <el-col :span="9">
                              <div class="imgContains size107a113">
                                <img :src="getImgUrl(succseeCaseItem.thumb)" alt="">
                              </div>
                            </el-col>
                            <el-col :span="15" class="companyTitle">
                              <el-row>
                                <el-col
                                  :span="24"
                                  class="color333 fontSize17 overEclipse"
                                >{{succseeCaseItem.name}}</el-col>
                              </el-row>
                              <el-row class="schema heightClap2">{{succseeCaseItem.summary}}</el-row>
                              <el-row>
                                <el-col :span="24" class="companyBtn height48">
                                  <el-tag
                                    size="mini"
                                    color="#6fbc85"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==0"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#00c1de"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==1"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#deb85e"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==2"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                </el-col>
                              </el-row>
                            </el-col>
                            <el-col :span="24" class="companyBorder">
                              <el-row>
                                <el-col :span="14">
                                  <span class="iconfont iconGroup- color999" v-if="succseeCaseItem.stateCode==4"></span>
                                  <span class="iconfont iconcuowu color999" v-else></span>
                                  <span class="color999" v-if="succseeCaseItem.stateCode==4">发布时间：{{succseeCaseItem.pdate}}</span>
                                  <span class="color999" v-else></span>
                                </el-col>
                                <el-col :span="10" class="textRight">
                                  <span
                                  @click="downLoad(succseeCaseItem.id)"
                                    class="iconfont iconxiazai- pointer fontSize20 marginRight16"
                                    v-if="succseeCaseItem.stateCode==4"
                                  ></span>
                                  <span
                                    class="iconfont iconshangchuan3 pointer fontSize20 marginRight16"
                                    @click="uploadItem(succseeCaseItem.id)"
                                    v-else
                                  ></span>
                                  <span
                                    class="iconfont iconbianji1 pointer fontSize20 marginRight16"
                                    @click="editItem(succseeCaseItem.id)"
                                  ></span>
                                  <span
                                    class="iconfont iconshanchu pointer fontSize20 marginRight16"
                                    @click="delIcon(succseeCaseItem.id)"
                                  ></span>
                                </el-col>
                              </el-row>
                            </el-col>
                          </el-row>
                        </el-col>
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0 bgFd"
                        >
                          <el-row
                            class="lineHeight195 pointer textCenter"
                            @click.native="addNewSolute"
                          >
                            <span class="iconfont icontianjia fontSize40"></span>
                            <span class="colorPrimary verticalAlignSuper">&nbsp;&nbsp;添加解决方案</span>
                          </el-row>
                        </el-col>
                      </el-row>
                    </el-col>
                  </el-row>
                </el-tab-pane>
                <el-tab-pane label="项目服务" name="fourth">
                  <el-row :gutter="20">
                    <el-col :span="22" class="singleProgram programList">
                      <el-row class="bgWhite">
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0"
                          v-for="succseeCaseItem in projectArr"
                          :key="succseeCaseItem.id"
                        >
                          <el-row>
                            <el-col :span="9">
                              <div class="imgContains size107a113">
                                <img :src="getImgUrl(succseeCaseItem.thumb)" alt="">
                              </div>
                            </el-col>
                            <el-col :span="15" class="companyTitle">
                              <el-row>
                                <el-col
                                  :span="24"
                                  class="color333 fontSize17 overEclipse"
                                >{{succseeCaseItem.name}}</el-col>
                              </el-row>
                              <el-row class="schema heightClap2">{{succseeCaseItem.summary}}</el-row>
                              <el-row>
                                <el-col :span="24" class="companyBtn height48">
                                  <el-tag
                                    size="mini"
                                    color="#6fbc85"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==0"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#00c1de"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==1"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#deb85e"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==2"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                </el-col>
                              </el-row>
                            </el-col>
                            <el-col :span="24" class="companyBorder">
                              <el-row>
                                <el-col :span="14">
                                  <span class="iconfont iconGroup- color999" v-if="succseeCaseItem.stateCode==4"></span>
                                  <span class="iconfont iconcuowu color999" v-else></span>
                                  <span class="color999" v-if="succseeCaseItem.stateCode==4">发布时间：{{succseeCaseItem.pdate}}</span>
                                  <span class="color999" v-else></span>
                                </el-col>
                                <el-col :span="10" class="textRight">
                                  <span
                                  @click="downLoad(succseeCaseItem.id)"
                                    class="iconfont iconxiazai- pointer fontSize20 marginRight16"
                                    v-if="succseeCaseItem.stateCode==4"
                                  ></span>
                                  <span
                                    class="iconfont iconshangchuan3 pointer fontSize20 marginRight16"
                                    @click="uploadItem(succseeCaseItem.id)"
                                    v-else
                                  ></span>
                                  <span
                                    class="iconfont iconbianji1 pointer fontSize20 marginRight16"
                                    @click="editItem(succseeCaseItem.id)"
                                  ></span>
                                  <span
                                    class="iconfont iconshanchu pointer fontSize20 marginRight16"
                                    @click="delIcon(succseeCaseItem.id)"
                                  ></span>
                                </el-col>
                              </el-row>
                            </el-col>
                          </el-row>
                        </el-col>
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0 bgFd"
                        >
                          <el-row
                            class="lineHeight195 pointer textCenter"
                            @click.native="addNewSolute"
                          >
                            <span class="iconfont icontianjia fontSize40"></span>
                            <span class="colorPrimary verticalAlignSuper">&nbsp;&nbsp;添加解决方案</span>
                          </el-row>
                        </el-col>
                      </el-row>
                    </el-col>
                  </el-row>
                </el-tab-pane>
                <el-tab-pane label="应用商品" name="fifth">
                  <el-row :gutter="20">
                    <el-col :span="22" class="singleProgram programList">
                      <el-row class="bgWhite">
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0"
                          v-for="succseeCaseItem in commodityArr"
                          :key="succseeCaseItem.id"
                        >
                          <el-row>
                            <el-col :span="9">
                              <div class="imgContains size107a113">
                                <img :src="getImgUrl(succseeCaseItem.thumb)" alt="">
                              </div>
                            </el-col>
                            <el-col :span="15" class="companyTitle">
                              <el-row>
                                <el-col
                                  :span="24"
                                  class="color333 fontSize17 overEclipse"
                                >{{succseeCaseItem.name}}</el-col>
                              </el-row>
                              <el-row class="schema heightClap2">{{succseeCaseItem.summary}}</el-row>
                              <el-row>
                                <el-col :span="24" class="companyBtn height48">
                                  <el-tag
                                    size="mini"
                                    color="#6fbc85"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==0"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#00c1de"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==1"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                  <el-tag
                                    size="mini"
                                    color="#deb85e"
                                    class="colorWhite"
                                    v-for="(btnItem,index) in succseeCaseItem.projectTags"
                                    v-show="btnItem"
                                    v-if="index==2"
                                    :key="btnItem"
                                  >{{btnItem}}</el-tag>
                                </el-col>
                              </el-row>
                            </el-col>
                            <el-col :span="24" class="companyBorder">
                              <el-row>
                                <el-col :span="14">
                                  <span class="iconfont iconGroup- color999" v-if="succseeCaseItem.stateCode==4"></span>
                                  <span class="iconfont iconcuowu color999" v-else></span>
                                  <span class="color999" v-if="succseeCaseItem.stateCode==4">发布时间：{{succseeCaseItem.pdate}}</span>
                                  <span class="color999" v-else></span>
                                </el-col>
                                <el-col :span="10" class="textRight">
                                  <span
                                  @click="downLoad(succseeCaseItem.id)"
                                    class="iconfont iconxiazai- pointer fontSize20 marginRight16"
                                    v-if="succseeCaseItem.stateCode==4"
                                  ></span>
                                  <span
                                    class="iconfont iconshangchuan3 pointer fontSize20 marginRight16"
                                    @click="uploadItem(succseeCaseItem.id)"
                                    v-else
                                  ></span>
                                  <span
                                    class="iconfont iconbianji1 pointer fontSize20 marginRight16"
                                    @click="editItem(succseeCaseItem.id)"
                                  ></span>
                                  <span
                                    class="iconfont iconshanchu pointer fontSize20 marginRight16"
                                    @click="delIcon(succseeCaseItem.id)"
                                  ></span>
                                </el-col>
                              </el-row>
                            </el-col>
                          </el-row>
                        </el-col>
                        <el-col
                          :span="11"
                          :offset="1"
                          class="border padding20 marginTop24 paddingBottom0 bgFd"
                        >
                          <el-row
                            class="lineHeight195 pointer textCenter"
                            @click.native="addNewSolute"
                          >
                            <span class="iconfont icontianjia fontSize40"></span>
                            <span class="colorPrimary verticalAlignSuper">&nbsp;&nbsp;添加解决方案</span>
                          </el-row>
                        </el-col>
                      </el-row>
                    </el-col>
                  </el-row>
                </el-tab-pane>
              </el-tabs>
            </div>
          </div>
        </div>
      </el-main>
    </el-container>
  </el-container>
</template>
<style scoped>
.marginTop34 {
  margin-top: 34px;
}
.marginTop45 {
  margin-top: 45px;
}
.companyBorder {
  border-top: 1px solid #ebebeb;
  line-height: 40px;
}
.schema {
  height: 48px;
  font-size: 14px;
  font-family: SourceHanSansCN-Light;
  font-weight: 300;
  color: rgba(102, 102, 102, 1);
  line-height: 24px;
  margin: 12px 0;
}
.companyName {
  font-size: 20px;
  font-family: SourceHanSansCN-Medium;
  font-weight: 500;
  color: rgba(51, 51, 51, 1);
  line-height: 27px;
}
.companyContent {
  font-size: 16px;
  font-family: SourceHanSansCN-Regular;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
  line-height: 17px;
  margin: 20px 0;
}
.companySmallContent {
  margin: 0 auto !important;
  margin-top: 34px;
  width: 265px;
  font-size: 14px;
  font-family: SourceHanSansCN-Light;
  font-weight: 300;
  color: rgba(102, 102, 102, 1);
  line-height: 30px;
}
.el-breadcrumb,
.el-breadcrumb__separator {
  line-height: 70px;
  font-size: 14px;
  color: #666666;
}
.el-breadcrumb__inner {
  font-size: 14px;
  color: #666666;
  font-weight: 500 !important;
}
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}
.elMain {
  right: 0;
  position: relative;
  padding: 0;
}
.el-container {
  border: 0 !important;
}
.el-upload__tip {
  text-align: center;
  line-height: 40px;
}
.size170 {
  width: 170px;
  height: 170px;
  padding: 10px;
  background: #ffffff;
  margin: 45px auto;
}
.el-tabs__item {
  line-height: 70px;
}
</style>
<style>
.el-upload-dragger {
  width: 1100px;
}
</style>

<script>
import VMenu2 from "../../layout/default/components/menu/supplierIndex";
import getImgUrl from "src/common/setting";
export default {
  name: "SuupplierHome",
  components: {
    VMenu2
  },
  data() {
    return {
      chooseSupplier: 3, //服务商选择
      value5: 3.7, //评分
      activeName: "first", //tab选项
      corpBaseInfo: [], //供应商基本资料
      corpContent: "", //公司介绍
      corpScope: [], //业务范围
      solution: [], //解决方案
      succseeCase: [], //成功案例
      projectArr: [], //项目服务
      commodityArr: [], //应用商品
      successTitle: "成功案例",
      casesCount:0,
      solutionCount:0,
      tabStatus:'',//当前tab(解决方案,成功案例，项目服务，应用商品)
    };
  },
  mounted() {
    this.initapiCorpInfo(); //供应商信息
  },
  methods: {
    getImgUrl(url) {
      return this.utils.getImgUrl(url);
    },
    async initapiCorpInfo() {
      const { $api } = this;
      const resData = await $api.user.apiCorpInfo();
      if (resData.code == 0) {
        this.corpBaseInfo = resData.data.corpBaseInfo;
        this.corpContent = resData.data.corpContent;
        this.corpScope = resData.data.corpScope;
        this.casesCount = resData.data.casesCount;
        this.solutionCount = resData.data.solutionCount;
      } else {
        this.$message.error(data.msg);
      }
    },
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    //点击切换tab
    tabsClick(e) {
      if(e.name == "second"){
        this.solutionMethod();
        this.tabStatus = 'solution';
      }else if (e.name == "third") {
        this.succseeCaseMethod();
        this.tabStatus = 'succseeCase';
      }else if (e.name == "fourth") {
        this.projectServices();
        this.tabStatus = 'projectServices';
      }else if (e.name == "fifth") {
        this.commodity();
        this.tabStatus = 'commodity';
      }
    },
    async solutionMethod() {
      const { $api } = this;
      const resData = await $api.user.apiCorpSolution();
      if (resData.code == 0) {
        this.solution = resData.data;
      } else {
        this.$message.error(resData.msg); 
      }
    },
    async succseeCaseMethod() {
      const { $api } = this;
      const resData = await $api.user.apiCorpCases();
      if (resData.code == 0) {
        this.succseeCase = resData.data;
      } else {
        this.$message.error(resData.msg);
      }
    },
    async projectServices() {
      const { $api } = this;
      const resData = await $api.user.apiCorpProject();
      if (resData.code == 0) {
        this.projectArr = resData.data;
      } else {
        this.$message.error(resData.msg);
      }
    },
    async commodity() {
      const { $api } = this;
      const resData = await $api.user.apiCorpDevice();
      if (resData.code == 0) {
        this.commodityArr = resData.data;
      } else {
        this.$message.error(resData.msg);
      }
    },
    //点击新增解决方案
    addNewSolute() {
      this.$router.push({
        name: "AddNewSolute",
        query: {
          type: 0,
          title: this.successTitle,
          itemId: "",
          tabStatus:this.tabStatus,
        }
      });
    },
    //点击删除
    // delIcon(e){
    //   console.log( e );
    // }
    async delIcon(e) {
        const { $api } = this;
        let dataObj = {
          contentId: e
        };
        const resData = await $api.user.apiCorpCasesDelete(dataObj);
        console.log(resData);
        if (resData.code == 0) {
          this.$message({
            type: "success",
            message: "删除成功!"
          });
          this.$router.go(0)
        } else {
          this.$message.error(resData.msg);
        }
      },
      //点击上传
      uploadItem(id){
        this.$confirm('上传之后等待后台管理员审核, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.realUpload(id)
        })
      },
      async realUpload(id){
      const {$api } = this;
        let dataObj = {
            contentId: id,
            'publish':true,
          };
      const resData = await $api.user.apiCorpCasesPublish(dataObj);
      if (resData.code == 0) {
        this.$message.success('信息提交成功，等待后台管理员审核');
        this.$router.go(0)
      }else{
      this.$message.error(resData.msg);
      }
      },
      //点击上传
      downLoad(id){
        this.$confirm('您确定执行该操作, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.realUpload(id)
        })
      },
      async realUpload(id){
      const {$api } = this;
        let dataObj = {
            contentId: id,
            'publish':false,
          };
      const resData = await $api.user.apiCorpCasesPublish(dataObj);
      if (resData.code == 0) {
        this.$message.success('信息提交成功，等待后台管理员审核');
        this.$router.go(0)
      }else{
      this.$message.error(resData.msg);
      }
      },
      editItem(id){
        this.$router.push({
          'name':'SolutionManagement',
          query:{
            'id':id,
            'tabStatus':this.tabStatus,
          }
        })
      }
    }
  }
</script>

